<?php
/****************************************************************************

	COPYRIGHT(C) WWW.MAXSI.DK, MAXSI SOFTWARE, SORTIE 2009
	ALL RIGHTS RESERVED

	Maxsi Distribution ContentServer/ Branch
	Scripts running a Maxsi Distribution Compatible Content Server.	
	
	users.php
	Provides a form for logging in.

****************************************************************************/

echo '<p><b class="text_big">List of users on this content server:</b><br />';

if ( $md_accountsys )
{
	if ( !$md_account )
	{
		echo 'You need to <a href="?action=login">Log In</a> to access this page.';
	}
	else
	{
		if ( !$md_account_admin )
		{
			echo 'Sorry, you need admin rights to access this page.';
		}
		else
		{		
			echo 'You are logged in as '.$md_account_name.'. ';
			echo '<br /><br />';
			
			$slot	=	md_sql("SELECT * FROM ".md_GetDatabaseName('users')." ORDER BY username ASC");
			
			for ( $i = 0; $i < $md_sql_total[$slot]; $i++)
			{
				echo '<a href="?action=public_users&amp;id='.$md_sql_row[$slot]['id'].'">'.$md_sql_row[$slot]['username'] . '</a>';
				if ( $md_sql_row[$slot]['admin'] )
				{
					echo ' (Admin)';
				}
				echo '<br />';
			}
			
			md_clearslot($slot);
		}
	}
}
else
{
	echo 'This Content Server does not support an account system.</p>';
} 

echo '</p>'
?>